import { Module, Store } from "vuex";
const createModule = <S, R>(store: Module<S, R>) => store as Store<S>;

interface SearchState {
  search_key: string
}

let state: SearchState = {
  search_key: '',
};
// 定义一个 module
export default createModule({
  namespaced: true,
  state: state,
  actions: {
    setSearchKey({ commit }, search_key: any) {
      commit("setSearchKey", search_key);
    },
  },
  mutations: {
    setSearchKey(state, search_key) {
      state.search_key = search_key
    }
  },
});
